package com.tony.blog.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * @Title: SysDeptEntity
 * @Auther: 皮蛋布丁
 * @Date: 2021/07/09/10:05
 * @Description: 部门管理
 */

@Data
@TableName("sys_dept")
public class SysDeptEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    //部门主键ID
    @TableId
    private Long deptId;

    //上级部门ID，一级部门为0
    @NotNull(message = "父级部门必填!")
    private Long parentId;

    //部门名称
    @NotBlank(message = "部门名称不能为空!")
    private String name;

    //上级部门名称
    @TableField(exist=false)
    private String parentName;

    //排序编号
    private Integer orderNum;

    //删除标记
    @TableLogic
    private Integer delFlag;

    /**
     * ztree属性
     */
    @TableField(exist=false)
    private Boolean open;

    @TableField(exist=false)
    private List<?> list;
}